package love.xiaohh.minio.config;

import com.alibaba.fastjson.JSON;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 * minio的属性配置类
 * </p>
 *
 * @author XiaoHH
 * @version 1.0
 * @date 2021-11-21 星期日 9:30:31
 * @file MinioProperties.java
 */
@Configuration
@ConfigurationProperties(prefix = "minio")
public class MinioProperties {

    /**
     * minio的主机地址
     */
    private String host;

    /**
     * minio的端口
     */
    private int port = 9000;

    /**
     * minio的用户名
     */
    private String accessKey;

    /**
     * minio的密码
     */
    private String secretKey;

    /**
     * 是否是https安全的链接
     */
    private boolean secure;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public boolean isSecure() {
        return secure;
    }

    public void setSecure(boolean secure) {
        this.secure = secure;
    }

    /**
     * 将本对象转换为json格式
     *
     * @return 转换后的json
     */
    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
